package com.sc.nft.entity.dto;

import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.StrUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;
@Data
public class BettingDTO {
    @ApiModelProperty("第一位")
    @NotNull(message = "编号不可为空")
    @Range(min = 0,max = 9,message = "编号范围为0-9")
    private Integer v1;

    @ApiModelProperty("第二位")
    @NotNull(message = "编号不可为空")
    @Range(min = 0,max = 9,message = "编号范围为0-9")
    private Integer v2;

    @ApiModelProperty("第三位")
    @NotNull(message = "编号不可为空")
    @Range(min = 0,max = 9,message = "编号范围为0-9")
    private Integer v3;

    @ApiModelProperty("第四位")
    @NotNull(message = "编号不可为空")
    @Range(min = 0,max = 9,message = "编号范围为0-9")
    private Integer v4;

    @ApiModelProperty("第五位")
    @NotNull(message = "编号不可为空")
    @Range(min = 0,max = 9,message = "编号范围为0-9")
    private Integer v5;


    @ApiModelProperty("组合参数,前端不需要传入")
    private String lotteryDrawResult;


    public void combination(){
        String format = StrUtil.format("{}{}{}{}{}", this.v1, this.v2, this.v3, this.v4, this.v5);
        this.lotteryDrawResult= Convert.toStr(format);
    }

}
